home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / fax_sstv / ezsstv / irq.txt < prev    next >
Text File  |  1996-06-18  |  4KB  |  107 lines

  1.                 Interrupts
  2.                 ----------
  3.  
  4.  
  5. What is an IRQ?
  6. ---------------
  7.  
  8. IRQ is an abbreviation for Interrupt Request.
  9.  
  10. What is an Interrupt?
  11.  
  12. There are basically two ways the Central Processing Unit
  13. (CPU) of your computer can talk to peripheral devices such 
  14. as printers and serial ports.
  15.  
  16. 1. Polled - CPU constantly asks about the status.
  17.  
  18. 2. Interrupts - Device interrupts CPU when it needs attention.
  19.  
  20. With polled operation, the CPU is constantly asking all the
  21. devices:
  22.  
  23.         "Serial port, do you have anything for me?"
  24.         "Printer port, are you ready for another character?"
  25.         "Keyboard, was a key pressed?"
  26.         "Floppy drive, did you find that sector yet?
  27.  
  28. This wastes a lot of time because the answer is usually the
  29. same:  "I don't have anything for you now, CPU."
  30.  
  31. The alternative is for the device to "interrupt" the CPU when
  32. it needs attention.  The CPU stops what it is doing, remembers
  33. where it was, does something for the I/O device, and goes back
  34. to what it was doing.  Much like answering the telephone.  You 
  35. don't constantly pick it up to see if anyone is there.  When it
  36. rings you answer it, transfer some information, and generally
  37. go back to what you were doing before it rang.
  38.  
  39. The original IBM PC had the ability to use 8 different
  40. interrupts:
  41.  
  42.         IRQ             Standard Usage
  43.         ---             --------------
  44.         0               Timer
  45.         1               Keyboard
  46.         2               Video display
  47.         3               Serial port 2
  48.         4               Serial port 1
  49.         5               Printer port 2
  50.         6               Floppy disk controller
  51.         7               Printer port
  52.  
  53. When the IBM PC/AT was introduced, additional interrupts were
  54. made available:
  55.  
  56.         IRQ             Standard Usage
  57.         ---             --------------
  58.         8               Real-time clock
  59.         9               Replaced IRQ 2 
  60.         10              spare
  61.         11              spare
  62.         12              spare
  63.         13              Numeric Coprocessor
  64.         14              Hard disk controller
  65.         15              spare
  66.  
  67.  
  68. Ten of these are available from the expansion slots, others
  69. can be used only by devices on the mother board.
  70.  
  71. Clearly the hardware and software configuration must agree.
  72. If a serial port generates IRQ 4 but the software thinks
  73. IRQ 4 means the printer is ready for another character, 
  74. the system won't work properly.
  75.  
  76. The design of the old standard ISA bus does not allow two 
  77. different devices to share the same interrupt.
  78.  
  79.  
  80. IRQ Selection
  81. -------------
  82.  
  83. Rather than sitting there, contstantly asking whether the 
  84. audio input line has changed, this program uses interrupts
  85. to be notified when an audio zero crossing has occurred.
  86.  
  87. Each serial port is assigned a particular interrupt.  As
  88. tabluated above, COM1 will normally use IRQ 4 and COM2 will
  89. use IRQ 3.  When using one of these, in a standard 
  90. configuration, all you have to do is:
  91.         - Display the "Setup" menu.
  92.         - Pick the "SSTV Interface" item.
  93.         - Choose COM1 or COM2.
  94.  
  95. COM3 and COM4 can be a little more confusing.  As shown above,
  96. COM3 and COM4 originally used the same interrupts as COM1 and 
  97. COM2.  This meant that the devices sharing an interrupt could
  98. not be used at the same time.  More modern serial port cards
  99. give you a choice of other interrupts.  For example, my 
  100. COM3 uses IRQ 11 and COM4 uses IRQ 12.  There is no standard
  101. assignment in this case, and every machine will be different.
  102.  
  103. In the case of COM3 and COM4, you will also have to pick the 
  104. "Interrupt" item from the "Setup" menu and choose the interrupt
  105. used by the serial port.
  106.  
  107.